#!/usr/bin/env python3
import dbfread
import sys

settlefile = sys.argv[1]
table = dbfread.DBF(settlefile, encoding='GBK')

for record in table:
	#print(record['instrID'], ":", record['clearPrice'])
	print("update t_settlementprice set settlementprice='" + str(record['clearPrice']) + "' where instrumentid='" + str(record['instrID']) + "';")
